<template>
	<view>
		<view class="pusher-wrap">
			<view class="text">联系电话：</view>
			<view class="text">{{phone}}</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				mainid:'',
				phone:''
			}
		},
		onLoad() {
			uni.getStorage({
				key: 'user',
				success: (res) => {
					this.mainid = res.data.id;
					this.getPhoneNumber()
				}
			});
			
		},
		methods: {
			getPhoneNumber() {
				uni.request({
					header: {
						'Content-Type': 'application/x-www-form-urlencoded', //自定义请求头信息
					},
					url: getApp().globalData.url + 'mch/getSuper/' + this.mainid, //仅为示例，并非真实接口地址。
					method: 'POST',
					data: {
						"id": this.mainid,
					},
					success: (res) => {
						uni.hideLoading(); //关闭加载动画
						console.log('getSuper：',res);
						
						if (res.data.status == '200') {
							this.phone = res.data.data.invitePhone
						} else {
							uni.showToast({
								title: res.data.msg,
								icon: 'none',
								duration: 2000
							});
						}
					},
					fail: (error) => {
						// this.checks = true
						console.log(error)
					}
				});
			},
		}
	}
</script>

<style>
	
	.pusher-wrap{
		display: flex;
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
		background-color: white;
		margin: 30upx;
		padding: 30upx;
		border-radius: 8upx;
	}
	.pusher-wrap .text{
		font-size: 34upx;
	}
</style>
